package com.wenjh.jdmzt.android.adapter;

import java.util.List;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.wenjh.jdmzt.R;
import com.wenjh.jdmzt.android.synctask.LoadImageUtil;
import com.wenjh.jdmzt.android.view.HandyListView;
import com.wenjh.jdmzt.service.model.Image;

public class ImageListAdapter extends BaseListAdapter<Image> {
	HandyListView listView = null;
	
	public ImageListAdapter(Context context, HandyListView listView, List<Image> list) {
		super(context, list);
		this.listView = listView;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		if(convertView == null) {
			convertView = inflate(R.layout.listitem_image);
		}
		
		ImageView imageView = (ImageView) convertView.findViewById(R.id.imageview);
		LoadImageUtil.loadImage(getItem(position), imageView, listView, false, true);
		
		return convertView;
	}

}
